import { createRouter, createWebHistory } from 'vue-router'

//导入组件
import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'
import HomeVue from '@/views/home/Home.vue'
import SiteOverVue from '@/views/SiteMana/SiteOver.vue'
import TrafficAnalVue from '@/views/SiteMana/TrafficAnal.vue'
import StatusVue from '@/views/SiteMana/Status.vue'
import DeviceManaVue from '@/views/DeviceMana/DeviceMana.vue'
import WarnManaVue from '@/views/WarnMana/WarnMana.vue'
import WarnStraVue from '@/views/WarnMana/WarnStra.vue'
import AIVue from '@/views/AI/AI.vue'
import AIDetailVue from '@/views/AI/AIDetail.vue'
import UserUpdateVue from '@/views/user/UserUpdate.vue'
import Homepage from "@/views/StorageEngine/Homepage.vue"
import ResourcesCenter from "@/views/Center/ResourcesCenter.vue"
import SiteCenter from "@/views/Center/SiteCenter.vue"
import Overview from "@/views/StorageEngine/Overview.vue"
import Capacity from "@/views/StorageEngine/Capacity.vue"
import VirtualCenter from "@/views/Center/VirtualCenter.vue"
import MonitorCenter from "@/views/Center/MonitorCenter.vue"
import DeviceCenter from "@/views/Center/DeviceCenter.vue"
import ApCenter from "@/views/Center/ApCenter.vue"
import ServerCenter from "@/views/Center/ServerCenter.vue"
import AlarmCenter from "@/views/Center/AlarmCenter.vue"
import DvCenter from "@/views/Center/DvCenter.vue"
import AdminCenter from '@/views/Center/AdminCenter.vue'
//定义路由关系
const routes = [
    { path: '/login', component: LoginVue },
    {
        path: '/', 
        component: LayoutVue, 
        redirect: '/home', 
        children: [
            //主页
            { path: '/home', component: HomeVue },

            //存储引擎
            { path: '/homepage', component: Homepage },
            { path: '/overview', component: Overview },
            { path: '/capacity', component: Capacity },
            //综合管理中心
            { path: '/resourcesCenter', component: ResourcesCenter },
            { path: '/siteCenter', component: SiteCenter },
            { path: '/virtualCenter', component: VirtualCenter },
            //监控中心
            { path: '/monitorCenter', component: MonitorCenter},
            { path: '/adminCenter', component: AdminCenter },
            { path: '/deviceCenter', component: DeviceCenter},
            { path: '/apCenter', component: ApCenter},
            { path: '/serverCenter', component: ServerCenter},
            { path: '/alarmCenter', component: AlarmCenter},
            { path: '/dvCenter', component: DvCenter },
            
            
            { path: '/siteOver', component: SiteOverVue },
            { path: '/trafficAnal', component: TrafficAnalVue },           
            { path: '/status', component: StatusVue },
            { path: '/deviceMana/:id?', component: DeviceManaVue },
            { path: '/warnMana', component: WarnManaVue },
            { path: '/warnStra', component: WarnStraVue },
            { path: '/ai', component: AIVue },
            { path: '/ai/aiDetail/:id?', component: AIDetailVue },
            { path: '/user/update', component: UserUpdateVue }
        ]
    }
]

//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes
})

//导出路由
export default router